package com.ruoyi.bookbus.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.bookbus.mapper.BookProductMapper;
import com.ruoyi.bookbus.domain.BookProduct;
import com.ruoyi.bookbus.service.IBookProductService;

/**
 * 商品Service业务层处理
 * 
 * @author zsq-cj
 * @date 2025-10-21
 */
@Service
public class BookProductServiceImpl implements IBookProductService 
{
    @Autowired
    private BookProductMapper bookProductMapper;

    /**
     * 查询商品
     * 
     * @param id 商品主键
     * @return 商品
     */
    @Override
    public BookProduct selectBookProductById(Long id)
    {
        return bookProductMapper.selectBookProductById(id);
    }

    /**
     * 查询商品列表
     * 
     * @param bookProduct 商品
     * @return 商品
     */
    @Override
    public List<BookProduct> selectBookProductList(BookProduct bookProduct)
    {
        return bookProductMapper.selectBookProductList(bookProduct);
    }

    /**
     * 新增商品
     * 
     * @param bookProduct 商品
     * @return 结果
     */
    @Override
    public int insertBookProduct(BookProduct bookProduct)
    {
        return bookProductMapper.insertBookProduct(bookProduct);
    }

    /**
     * 修改商品
     * 
     * @param bookProduct 商品
     * @return 结果
     */
    @Override
    public int updateBookProduct(BookProduct bookProduct)
    {
        return bookProductMapper.updateBookProduct(bookProduct);
    }

    /**
     * 批量删除商品
     * 
     * @param ids 需要删除的商品主键
     * @return 结果
     */
    @Override
    public int deleteBookProductByIds(Long[] ids)
    {
        return bookProductMapper.deleteBookProductByIds(ids);
    }

    /**
     * 删除商品信息
     * 
     * @param id 商品主键
     * @return 结果
     */
    @Override
    public int deleteBookProductById(Long id)
    {
        return bookProductMapper.deleteBookProductById(id);
    }
}
